<?php
App::uses('Controller', 'Controller');
class AppController extends Controller {	
	  public $components = array(
        'Acl',
        'Auth' => array(
            'authorize' => array(
                'Actions' => array('actionPath' => 'controllers')
            )
        ),
        'Session',
        'Common'     
    );
    
    public $helpers = array('Html', 'Form', 'Session');
	
	public function beforeFilter() {
        //$this->Auth->allow();    
        $this->Auth->actionPath = 'controllers/';
        $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login');
        $this->Auth->logoutRedirect = array('controller' => 'users', 'action' => 'login');
        $this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'index');
        $this->set('logged_in',$this->is_LoggedIn());
        
        
    }
    
    public function is_LoggedIn() {
        $logged_in = FALSE;
        if($this->Auth->user()) {
               $logged_in = TRUE;
         }
        	return $logged_in;
     }
   
       
}



